package com.example.steveaoblogdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.steveaoblogdemo.entity.Articles;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;



@Mapper
public interface ArticlesMapper extends BaseMapper<Articles> {
    @Insert("insert into articles (id,author,title,summarize,content,tags," +
            "category,create_time" +
            ") values (#{id},#{author},#{title},#{summarize},#{content},#{tags},#{category},#{createTime})")
    int addBlog(Integer id,String author, String title,
                      String summarize, String content,String tags,String category, String createTime);
    @Update("update articles set author=#{author},title=#{title},summarize=#{summarize},content=#{content}," +
            "tags=#{tags},category=#{category},create_time=#{createTime} where id=#{id}")
    int updateBlog(String author, String title,
                   String summarize, String content,String tags,String category, String createTime,Integer id);
}
